<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>空间主页</title>
    <link rel="stylesheet" href="../css/spaces-main.css">
    <script type="text/javascript" src="../js/space.js"></script>
    <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
</head>

<body>
<!--**************顶部导航****************-->
<%@include file="../jsp/common/nav.jsp"%>
<!--**************左侧导航****************-->
<%@include file="../jsp/common/sidebar-scroll.jsp"%>
<!--***************空间右侧主界面*******************-->
<c:set var="user" value="${sessionScope.user}"/>
<c:set var="space" value="${sessionScope.space}"/>
<div class="right">
    <!--标题导航-->
    <div class="spaces-nav">
        <span class="nav-title"><a href="/index/main?id=${user.id}">学习空间</a></span>
        >
        <span>${space.name}</span>
    </div>
    <!--空间标识-->
    <div class="space-title">
        <img src="../images/${space.spaceimage}" />
        <span class="nav-title2">${space.name}</span>
        <span><a href="#">收藏&nbsp;0&nbsp;</a></span>
        <span><a href="#">点赞&nbsp;1&nbsp;</a></span>
        <c:if test="${result==null}">
            <span><a href="${pageContext.request.contextPath}/space/space-joinspace?id=${user.id}" class="button1">加入空间</a></span>
        </c:if>
        <c:if test="${result!=null}">
            <span><a href="${pageContext.request.contextPath}/space/space-tuichu?id=${user.id}&space_id=${space.id}" class="button1">退出空间</a></span>
        </c:if>
    </div>
    <!--空间成员-->
    <div class="manage-member">
        <div class="manage-title">管理团队</div>
        <div class="member">
            <li class="member-item">
                <a href="/users/user-dongtai?id=${requestScope.user.id}">
                    <img src="../images/${requestScope.user.userLogo}.jpg" />
                    <p class="member-name">${requestScope.user.username}</p>
                </a>
            </li>
        </div>
    </div>
    <div class="main-area">
        <!--资源话题区-->
        <div class="resouceArea">
            <div class="manage-title">最新资源</div>
            <div class="area-item">
                <c:forEach items="${reList}" var="r">
                    <li>
                        <a href="/resource/space-resource-show?id=${r.id}">${r.title}
                            <span class="time"><fmt:formatDate value="${r.updatetime}" pattern="yyyy年M月dd日"/></span>
                        </a>
                    </li>
                </c:forEach>
            </div>
        </div>
        <!--活跃话题区-->
        <div class="topicArea">
            <div class="manage-title">最新话题</div>
            <div class="area-item">
            <c:forEach items="${discussList}" var="discuss">
                <li>
                    <a href="/discuss/discuss-detail?id=${discuss.id}">${discuss.title}
                    <span class="time"><fmt:formatDate pattern="yyyy-MM-dd"
                                                       value="${discuss.createdate}"/></span>
                    </a>
                </li>
            </c:forEach>
            </div>
        </div>
    </div>
</div>
</body>
</html>
